Bugfix - JSON connector doesnt retain unicode characters during load#509
Bugfix - JSON connector doesnt retain unicode characters during load#509
Conversation
| /** | ||
| * Test for issue #508: JSON connector should preserve unicode escape sequences. | ||
| */ | ||
| class JsonNodeToStringCodecUnicodeTest { |
There was a problem hiding this comment.
So rather than creating a new test class for this we should be able to add this to the JsonNodeToStringCodecTest. We already have a should_convert_from_valid_external method which verifies the ability of that codec to handle legit incoming JsonNodes... and IIUC this is just another case of that. Something like the following should do it:
String unicodeEscapeString = "\\u001a\\u001aL\\\\";
String mixedContentString = "Text with \\\\u001a unicode \\\\u001aL\\\\\\\\ escapes";
assertThat(codec)
.convertsFromExternal(nodeFactory.textNode(unicodeEscapeString))
.toInternal(unicodeEscapeString)
.convertsFromExternal(nodeFactory.textNode(mixedContentString))
.toInternal(mixedContentString);
Thing is... if I add that test to 1.x and run it (with no additional modifications, specifically without the changes to JsonNodeToStringCodec also included in this PR) the test already passes. So are we sure there isn't something else going on here?
|
Hey @msmygit, I built a distribution from the tag of 1.11.0 + your change and I'm still seeing bogus results: Did I muck something up in the above? |
|
It looks like I did miss the |
|
Closing per discussion on the corresponding issue |
Fixes #508